<script>
import GmTable from "@/view/components/gmTable.vue";
import {getToken} from "@/util/util";
import {system} from "@/util/config";

export default {
  components: {
    GmTable: GmTable
  },
  data() {
    return {
      tableConfig: {
        control: 't-transportation-company-information',
        mainKey: 'companyCode', //数据主键，用于删除该条数据
        needDist: false,
      },
      tableColumns: [{
        name: 'companyName',
        label: '承运企业名称',
        id: 'companyName',
        search: true,
        required: false,
        searchType: 'input',
      }, {
        name: 'organizationId',
        label: '组织机构代码',
        id: 'organizationId',
        search: false,
        required: false,
        searchType: 'input',
      }, {
        name: 'organizationIdPath',
        label: '机构代码照片',
        id: 'organizationIdPath',
        search: false,
        required: false,
        searchType: 'upload',
        getValue: (params) => {
          return `${system.apiUrl}/${params}?token=${getToken()}`
        }
      }, {
        name: 'legalRepresentative',
        label: '法人姓名',
        id: 'legalRepresentative',
        search: false,
        required: false,
        searchType: 'input',
      }, {
        name: 'companyCreateTime',
        label: '企业成立时间',
        id: 'companyCreateTime',
        search: false,
        required: false,
        searchType: 'date',
      }, {
        name: 'districtName',
        label: '所属区划',
        id: 'districtName',
        search: false,
        required: false,
        searchType: 'dict',
        addHide: true,
      }, {
        name: 'districtCode',
        label: '所属区划',
        id: 'districtCode',
        search: false,
        hide:true,
        required: false,
        searchType: 'dict',
      }, {
        name: 'contactPersonName',
        label: '联系人',
        id: 'contactPersonName',
        search: false,
        required: false,
        searchType: 'input',
      }, {
        name: 'contactPhoneNumber',
        label: '联系人电话',
        id: 'contactPhoneNumber',
        search: false,
        required: false,
        searchType: 'input',
      },{
          name: 'createDate',
          label: '创建时间',
          id: 'createDate',
          search: false,
          searchType: 'state',
          addHide: true,
      },{
          name: 'createUserName',
          label: '创建人',
          id: 'createUserName',
          search: false,
          searchType: 'state',
          addHide: true,
      },{
          name: 'state',
          label: '状态',
          id: 'state',
          search: false,
          required: '/common/getItem/state',
          searchType: 'state',
      }],
    }
  },
}
</script>

<template>
  <div class="page-car">
    <gm-table :table-columns="tableColumns" :table-config="tableConfig"></gm-table>
  </div>
</template>

<style scoped>

</style>
